import request from "../utils/request.js";

export function categoryTree() {
  return request({
    url: "/catTree/categoryTree",
    method: "get",
  });
}
export function insert(category) {
  return request({
    url: "/catTree/insert",
    method: "post",
    data: category,
  });
}
export function update(category) {
  return request({
    url: "/catTree/update",
    method: "post",
    data: category,
  });
}

export function selectById(id) {
  return request({
    url: "/catTree/selectById",
    method: "post",
    params: {
      id,
    },
  });
}

export function deleteById(id) {
  return request({
    url: "/catTree/deleteById",
    method: "post",
    params: {
      id,
    },
  });
}
export function selectAllByName(name) {
  return request({
    url: "/catTree/selectAllByName",
    method: "post",
    params: {
      name,
    },
  });
}
